package com.nginx.web.util;

/**
 * api工具类
 */
public class ApiUtil {
    /**
     * 接口返回前台
     * @param resultEnum
     * @param msg
     */
    public static void back(ResultEnum resultEnum , String msg){
        Result build = Result.doBack(resultEnum).setMsg(msg).build();
        throw new ReturnException(build);
    }

    public static void back(ResultEnum resultEnum , String msg , Object result){
        Result build = Result.doBack(resultEnum).setMsg(msg).setResult(result).build();
        throw new ReturnException(build);
    }

    public static void back(ResultEnum resultEnum ){
        Result build = Result.doBack(resultEnum).build();
        throw new ReturnException(build);
    }

}
